package com.example.rgy;

import java.util.ArrayList;
import java.util.List;

public class RGYManager {

    public static List<RGYBean> rgyList = new ArrayList<RGYBean>();

    static {
        //int intersectionId, int trafficLightId, int redTime, int greenTime, int yellowTime, int status
        rgyList.add(new RGYBean(1, 1, 9, 9, 3, 1));
        rgyList.add(new RGYBean(2, 2, 8, 6, 3, 1));
        rgyList.add(new RGYBean(3, 3, 7, 7, 3, 1));
        rgyList.add(new RGYBean(4, 4, 8, 10, 3, 1));
        rgyList.add(new RGYBean(5, 5, 10, 15, 3, 1));
    }

    public static List<RGYBean> getRGYList() {
        return rgyList;
    }

    public static RGYBean getRGYById(int trafficId) {
        for (RGYBean bean : rgyList) {
            if (bean.getTrafficLightId() == trafficId) {
                return bean;
            }
        }
        return null;
    }


}
